import { Scene } from "../resource/scene";




class SceneManager {
    static {
        globalThis.__SceneManager__ = new SceneManager();
    }

    loadScene(scene: string | Scene): Scene {
        if (typeof scene == "string") {
            return Deno.core.ops.opLoadSceneFromName(scene);
        }
        else if (typeof scene == "object") {
            Deno.core.ops.opLoadScene(scene);
            return scene;
        }

    }

    preloadScene(scene: string): Scene {
        return Deno.core.ops.opPreloadScene(scene);

    }
}


export const scene = new SceneManager();
